import { http } from '@/tool/utils'
import { iPb } from '@/protobuf/interface'


export function CreateAdminMenu(formData: iPb.IDbAdminMenu):Promise<iPb.Admin.ICreateAdminMenuResponse> {
    return http.post("CreateAdminMenu", iPb.DbAdminMenu.toObject(iPb.DbAdminMenu.create(formData)))
}

export function UpdateAdminMenu(formData: iPb.IDbAdminMenu):Promise<iPb.Admin.IUpdateAdminMenuResponse> {
    return http.post("UpdateAdminMenu", iPb.DbAdminMenu.toObject(iPb.DbAdminMenu.create(formData)))
}

export function ReadAdminMenu(formData: iPb.Admin.IReadAdminMenuRequest):Promise<iPb.IDbAdminMenu> {
    return http.post("ReadAdminMenu", iPb.Admin.ReadAdminMenuRequest.toObject(iPb.Admin.ReadAdminMenuRequest.create(formData)))
}

export function DeleteAdminMenu(formData: iPb.Admin.IDeleteAdminMenuRequest):Promise<iPb.Admin.IDeleteAdminMenuResponse> {
    return http.post("DeleteAdminMenu", iPb.Admin.DeleteAdminMenuRequest.toObject(iPb.Admin.DeleteAdminMenuRequest.create(formData)))
}

export function SwitchStateAdminMenu(formData: iPb.Admin.ISwitchStateAdminMenuRequest):Promise<iPb.Admin.ISwitchStateAdminMenuResponse> {
    return http.post("SwitchStateAdminMenu", iPb.Admin.SwitchStateAdminMenuRequest.toObject(iPb.Admin.SwitchStateAdminMenuRequest.create(formData)))
}

export function SwitchDisplayAdminMenu(formData: iPb.Admin.ISwitchDisplayAdminMenuRequest):Promise<iPb.Admin.ISwitchDisplayAdminMenuResponse> {
    return http.post("SwitchDisplayAdminMenu", iPb.Admin.SwitchDisplayAdminMenuRequest.toObject(iPb.Admin.SwitchDisplayAdminMenuRequest.create(formData)))
}

